package com.site.controller;

import com.site.common.R;
import com.site.vo.TestFormVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 文档测试
 */
@Api(tags = "测试文档")
@RestController
public class SwaggerController extends BaseController {

    @ApiImplicitParam(name = "name",value = "姓名",required = true,dataTypeClass = String.class)
    @ApiOperation(value = "文档测试接口")
    @GetMapping("/swagger")
    public R<String> test(){
        return R.ok();
    }

    @PostMapping("/test")
    public R<TestFormVo> test(@RequestBody @Valid TestFormVo formVo){
        return R.ok(formVo);
    }
}
